// 供应商 
// 作者：洪刚
import axios from "axios";

export default{
    //得到所有供应商
    async getSupplier(query = {}){
       const data = await axios.get("/api/supplier/all", {
        params:query
       });
       return data.data;
    },
    async deleteSupplier(id){
        await axios.delete("/api/supplier/"+id);
    },
    async addSupplier(user){
        const resp = await axios.post("/api/supplier/add", user);
        return resp.data;
    },
    async getSupplierById(id){
        const resp = await axios.get("/api/supplier/"+id);
        return resp.data;
    },
    async modifySupplier(u){
        await axios.put("/api/supplier/"+u._id, u);
    }
}